! function(e, t) {
  if ("object" == typeof exports && "object" == typeof module) module.exports = t();
  else if ("function" == typeof define && define.amd) define([], t);
  else {
    var n = t();
    for (var i in n)("object" == typeof exports ? exports : e)[i] = n[i]
  }
}(this, function() {
  return function(e) {
    function t(i) {
      if (n[i]) return n[i].exports;
      var o = n[i] = {
        exports: {},
        id: i,
        loaded: !1
      };
      return e[i].call(o.exports, o, o.exports, t), o.loaded = !0, o.exports
    }
    var n = {};
    return t.m = e, t.c = n, t.p = "", t(0)
  }([function(e, t, n) {
    "use strict";

    function i(e) {
      return e && e.__esModule ? e : {
        "default": e
      }
    }
    var o = n(1),
      a = i(o),
      r = n(14),
      d = i(r),
      s = navigator.userAgent,
      u = s.indexOf("wechatdevtools") > 0,
      A = s.indexOf("devtoolsedit") > 0;
    u ? (0, a["default"])() : A && (0, d["default"])()
  }, function(e, t, n) {
    "use strict";

    function i(e) {
      if (e && e.__esModule) return e;
      var t = {};
      if (null != e)
        for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]);
      return t["default"] = e, t
    }

    function o(e) {
      return e && e.__esModule ? e : {
        "default": e
      }
    }

    function a(e, t, n, i) {
      var o = {
        to: e,
        msg: t,
        command: n,
        ext: i
      };
      o.comefrom = "webframe", o.webviewID = p.webviewID, o = JSON.parse(JSON.stringify(o)), "backgroundjs" === e && (o.__id = D, D++), window.parent.postMessage(o, "*")
    }

    function r(e) {
      var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
        n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2],
        i = {
          sdkName: e,
          args: t
        },
        o = {
          isOn: n,
          url: location.href,
          title: document.title,
          desc: document.title,
          img_url: document.images.length ? document.images[0].src : g.DEFAULT_SHARE_IMG_URL,
          link: void 0
        };
      a("backgroundjs", i, M, o)
    }

    function d(e, t, n) {
      m.isWeapp || (console.group(new Date + " wx." + (0, m.getSdkDisplayName)(e) + " end"), console.debug((0, m.getSdkArgs)(e, t)), console.groupEnd()), "preVerifyJSAPI" === e && ! function() {
        var e = n.args.verifyJsApiList || [],
          t = n.sdkResExt,
          i = [],
          o = [];
        e.forEach(function(e) {
          (t.defaultPurview[e] || t.purviewFormGetA8key[e] || t.purviewFromPreVerify[e]) && (0 === o.length ? i.push(o) : 6 === o.length && (o = [], i.push(o)), o.push((0, m.getSdkDisplayName)(e)))
        }), m.isWeapp || (console.group(new Date + " 当前页面通过 wx.config 获取到的 JSSDK 权限如下"), console.table(i), console.groupEnd())
      }(), R[e] && R[e].fn ? R[e].fn(t) : g.registerMethod[e] && r(g.registerMethod[e])
    }

    function s(e, t, n) {
      window.WeixinJSBridge ? d(e, t, n) : document.addEventListener("WeixinJSBridgeReady", function() {
        d(e, t, n)
      })
    }

    function u(e) {
      var t = (e.data, e.eventName);
      C._subscribe[t] && C._subscribe[t](e.data)
    }

    function A() {
      window.WeixinJSBridge = C;
      var e = document.createEvent("UIEvent");
      e.initEvent("WeixinJSBridgeReady", !1, !1), document.dispatchEvent(e), v["default"].register(function() {
        var e = {},
          t = {};
        a("backgroundjs", e, "PULLDOWN_REFRESH", t)
      }), a("contentscript", {}, S)
    }

    function c() {
      "complete" === document.readyState ? A() : window.addEventListener("load", function(e) {
        A()
      }), document.addEventListener("generateFuncReady", function() {
        a("backgroundjs", {}, b)
      })
    }
    Object.defineProperty(t, "__esModule", {
      value: !0
    });
    var l = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
      return typeof e
    } : function(e) {
      return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
    };
    t["default"] = c;
    var g = n(2),
      p = n(3),
      m = n(4),
      f = n(5),
      I = o(f),
      h = n(6),
      v = o(h),
      E = n(9),
      y = i(E),
      M = "EXEC_JSSDK",
      w = "TO_APP_SERVICE",
      S = "SHAKE_HANDS",
      k = "COMMAND_GET_TITLE",
      b = "WEBVIEW_READY";
    (0, I["default"])(p.isAndroid ? "Android" : "iPhone");
    var D = 0,
      C = {},
      R = C._debugCache = {},
      B = C._subscribe = {},
      Q = C.privateCache = {};
    C.invoke = function(e) {
      var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
        n = arguments[2];
      return y[e] ? void y[e](t, n) : g.NotInvokeSdk[e] || /^__sys/.test(e) ? void 0 : ((0, m.isPrivateSdk)(e) ? (t.__id = +new Date, Q[t.__id] = n) : R[e] = {
        fn: n
      }, m.isWeapp || (console.group(new Date + " wx." + (0, m.getSdkDisplayName)(e) + " begin"), console.debug((0, m.getSdkArgs)(e, t)), console.groupEnd()), "disableScrollBounce" === e ? void v["default"].togglePullDownRefresh(t.disable) : void r(e, t))
    }, C.on = function(e, t) {
      R[e] = {
        fn: t
      }, r(e, {}, !0)
    }, C.call = function() {
      console.error("WeixinJSBridge.call 不被支持，请参考 http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html 进行正确调用")
    }, C.log = function(e) {
      console.log(e)
    }, C.publish = function(e, t, n) {
      e = n ? "sys_" + e : "publish_" + e;
      var i = {
        eventName: e,
        data: t
      };
      a("backgroundjs", i, w)
    }, C.subscribe = function(e, t) {
      B[e] = t
    }, window.addEventListener("message", function(e) {
      var t = e.data;
      if (t && "object" === ("undefined" == typeof t ? "undefined" : l(t))) {
        if (t && ("geolocation" === t.module || "locationPicker" === t.module)) {
          var n = t;
          return "geolocation" == t.module && (n = {
            module: "locationPicker",
            latlng: {
              lat: t.lat,
              lng: t.lng
            },
            poiaddress: "" + t.province + t.city,
            poiname: t.addr,
            cityname: t.city
          }), void alert("map handle:" + JSON.stringify(n))
        }
        var i = t.msg;
        if (i) {
          var o = t.command,
            r = t.ext;
          if ("webframe" === t.to && o && p.webviewID === t.webviewID && "INIT_DEVTOOLS_SUCCESS" !== o) {
            if ("MSG_FROM_APPSERVICE" === o) return void u(i);
            if ("COMMAND_GET_TITLE" === o) {
              var d = {
                title: document.title
              };
              return void a("backgroundjs", d, k)
            }
            var A = i.sdkName,
              c = i.res || {};
            if ((0, m.isPrivateSdk)(A)) {
              var g = r.args;
              return void Q[g.__id](c)
            }
            p.isAndroid && ("checkJsApi" === A ? c.checkResult = JSON.stringify(c.checkResult) : "chooseImage" === A && (c.localIds = JSON.stringify(c.localIds))), "GET_JSSDK_RES" !== o && "INVOKE_SDK" !== o || s(A, c, r), "STOP_PULL_DOWN_REFRESH" === o && v["default"].reset()
          }
        }
      }
    })
  }, function(e, t) {
    "use strict";
    Object.defineProperty(t, "__esModule", {
      value: !0
    });
    var n = {
        reportKeyValue: !0,
        reportIDKey: !0,
        systemLog: !0
      },
      i = {
        appId: !0,
        verifyAppId: !0,
        verifyNonceStr: !0,
        verifySignType: !0,
        verifySignature: !0,
        verifyTimestamp: !0,
        origin: !0,
        webviewId: !0,
        __isFromOn__: !0,
        __domain__: !0,
        __url__: !0
      },
      o = {
        "menu:share:timeline": "shareTimeline",
        "menu:share:appmessage": "sendAppMessage",
        "menu:share:qq": "shareQQ",
        "menu:share:weiboApp": "shareWeiboApp",
        "menu:share:QZone": "shareQZone"
      },
      a = {
        shareTimeline: "menu:share:timeline",
        sendAppMessage: "menu:share:appmessage",
        shareQQ: "menu:share:qq",
        shareWeiboApp: "menu:share:weiboApp",
        shareQZone: "menu:share:QZone",
        config: "preVerifyJSAPI"
      },
      r = {
        shareTimeline: "onMenuShareTimeline",
        sendAppMessage: "onMenuShareAppMessage",
        shareQQ: "onMenuShareQQ",
        shareWeiboApp: "onMenuShareWeibo",
        shareQZone: "onMenuShareQZone",
        "menu:share:timeline": "onMenuShareTimeline",
        "menu:share:appmessage": "onMenuShareAppMessage",
        "menu:share:qq": "onMenuShareQQ",
        "menu:share:weiboApp": "onMenuShareWeibo",
        "menu:share:QZone": "onMenuShareQZone",
        preVerifyJSAPI: "config",
        imagePreview: "previewImage",
        geoLocation: "getLocation",
        openProductViewWithPid: "openProductSpecificView",
        batchAddCard: "addCard",
        batchViewCard: "openCard",
        getBrandWCPayRequest: "chooseWXPay",
        showPickerView: "showPickerView",
        showDatePickerView: "showDatePickerView"
      },
      d = "http://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRt8Qia4lv7k3M9J1SKqKCImxJCt7j9rHYicKDI45jRPBxdzdyREWnk0ia0N5TMnMfth7SdxtzMvVgXg/0";
    t.NotInvokeSdk = n, t.registerMethod = o, t.methodTrans = a, t.DEFAULT_SHARE_IMG_URL = d, t.sdkDisplayName = r, t.doNotDisplayArgsConfig = i
  }, function(e, t) {
    "use strict";
    Object.defineProperty(t, "__esModule", {
      value: !0
    });
    var n = navigator.userAgent,
      i = n.match(/webview\/(\d*)/),
      o = i ? parseInt(n.match(/webview\/(\d*)/)[1]) : 0,
      a = n.indexOf("Android") !== -1,
      r = n.indexOf("iPhone") !== -1,
      d = n.indexOf("weapp") !== -1;
    t.isAndroid = a, t.isiPhone = r, t.webviewID = o, t.isWeapp = d
  }, function(e, t, n) {
    "use strict";

    function i(e) {
      return r.sdkDisplayName[e] || e
    }

    function o(e) {
      var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
        n = JSON.parse(JSON.stringify(t));
      if (delete n.verifyAppId, "preVerifyJSAPI" === e) n.jsApiList = n.verifyJsApiList || [], n.jsApiList.forEach(function(e, t) {
        n.jsApiList[t] = i(e)
      }), delete n.verifyJsApiList, n.verifyNonceStr && (n.nonceStr = n.verifyNonceStr), delete n.verifyNonceStr, n.verifySignature && (n.signature = n.verifySignature), delete n.verifySignature, n.verifyTimestamp && (n.timestamp = n.verifyTimestamp), delete n.verifyTimestamp, delete n.verifySignType;
      else
        for (var o in t) r.doNotDisplayArgsConfig[o] && delete n[o];
      return n
    }

    function a(e) {
      return /^private_/.test(e)
    }
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.isPrivateSdk = t.isWeapp = t.getSdkArgs = t.getSdkDisplayName = void 0;
    var r = n(2),
      d = navigator.userAgent.indexOf("weapp") > 0;
    t.getSdkDisplayName = i, t.getSdkArgs = o, t.isWeapp = d, t.isPrivateSdk = a
  }, function(e, t) {
    "use strict";

    function n(e) {
      var t = function() {
        return e
      };
      Object.defineProperty(navigator, "platform", {
        get: t
      })
    }
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t["default"] = n
  }, function(e, t, n) {
    "use strict";

    function i(e) {
      return e && e.__esModule ? e : {
        "default": e
      }
    }

    function o() {
      if (!E) {
        E = document.createElement("div");
        var e = document.createElement("i");
        "dark" === __wxConfig.window.backgroundTextStyle ? e.style.backgroundImage = "url(" + l["default"] + ")" : e.style.backgroundImage = "url(" + p["default"] + ")", e.style.width = "32px", e.style.position = "absolute", e.style.height = "6px", e.style.left = "50%", e.style.bottom = "20px", e.style.backgroundRepeat = "no-repeat", e.style.marginLeft = "-16px", e.style.backgroundSize = "cover", E.appendChild(e), E.style.width = "100%", E.style.position = "fixed", E.style.top = "0px", E.style.backgroundColor = __wxConfig.window.backgroundColor, document.body.insertBefore(E, document.body.firstChild)
      }
    }

    function a() {
      window.addEventListener("touchstart", function(e) {
        0 == window.scrollY && (o(), I = !0, h = e.touches[0].pageY, window.document.body.style.transition = "all linear 0", E.style.transition = "all linear 0")
      }, !0)
    }

    function r() {
      window.addEventListener("touchmove", function(e) {
        I && __wxConfig.window.enablePullDownRefresh && !M && (v = e.touches[0].pageY - h, v = Math.max(0, v), v = Math.min(m, v), window.document.body.style.marginTop = v + "px", E.style.height = v + "px")
      })
    }

    function d() {
      window.addEventListener("touchend", function(e) {
        I = !1, v > f ? ("function" == typeof y && y(), v = f, window.document.body.style.marginTop = v + "px", E.style.height = v + "px", setTimeout(s, 3e3)) : s()
      })
    }

    function s() {
      window.document.body.style.transition = "all linear 0.3s", window.document.body.style.marginTop = "0px", E && (E.style.transition = "all linear 0.3s", E.style.height = "0px")
    }

    function u(e) {
      M = e
    }
    Object.defineProperty(t, "__esModule", {
      value: !0
    });
    var A = n(3),
      c = n(7),
      l = i(c),
      g = n(8),
      p = i(g),
      m = 100,
      f = 50,
      I = !1,
      h = 0,
      v = 0,
      E = null,
      y = null,
      M = !1;
    t["default"] = {
      register: function(e) {
        A.isWeapp && (A.isAndroid || A.isiPhone) && window.__wxConfig && window.__wxConfig.window && window.__wxConfig.window.enablePullDownRefresh && (y = e, a(), r(), d())
      },
      reset: s,
      togglePullDownRefresh: u
    }
  }, function(e, t) {
    "use strict";
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t["default"] = ""
  }, function(e, t) {
    "use strict";
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t["default"] = ""
  }, function(e, t, n) {
    "use strict";

    function i(e) {
      return e && e.__esModule ? e : {
        "default": e
      }
    }

    function o(e, t) {
      var n = E();
      y(n, e), n.id = v(), document.body.appendChild(n), n.addEventListener("click", function(e) {
        var t = n.dataset.data;
        WeixinJSBridge.publish("onShareAppMessage", {
          data: t,
          path: location.pathname
        }, !0)
      }), t({
        errMsg: "insertShareButton:ok",
        shareButtonId: n.id
      })
    }

    function a(e, t) {
      var n = e.shareButtonId,
        i = document.getElementById(n);
      i ? (y(i, e), t({
        errMsg: "insertShareButton:ok"
      })) : t({
        errMsg: "insertShareButton:faile shareButtonId:" + n + " not found"
      })
    }

    function r(e, t) {
      var n = e.shareButtonId,
        i = document.getElementById(n);
      i ? (i.remove(), t({
        errMsg: "removeShareButton:ok"
      })) : t({
        errMsg: "removeShareButton:faile shareButtonId:" + n + " not found"
      })
    }

    function d(e, t) {
      var n = E();
      y(n, e, "contact"), n.id = v(), document.body.appendChild(n), n.addEventListener("click", function(e) {
        var t = n.dataset.sessionFrom;
        WeixinJSBridge.publish("insertContactButton", {
          sessionFrom: t
        }, !0)
      }), t({
        errMsg: "insertShareButton:ok",
        contactButtonId: n.id
      })
    }

    function s(e, t) {
      var n = e.contactButtonId,
        i = document.getElementById(n);
      i ? (y(i, e, "contact"), t({
        errMsg: "insertShareButton:ok"
      })) : t({
        errMsg: "updateContactButton:faile contactButtonId:" + n + " not found"
      })
    }

    function u(e, t) {
      var n = e.contactButtonId,
        i = document.getElementById(n);
      i ? (i.remove(), t({
        errMsg: "removeContactButton:ok"
      })) : t({
        errMsg: "removeContactButton:faile contactButtonId:" + n + " not found"
      })
    }
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.removeContactButton = t.updateContactButton = t.insertContactButton = t.removeShareButton = t.updateShareButton = t.insertShareButton = void 0;
    var A = n(10),
      c = i(A),
      l = n(11),
      g = i(l),
      p = n(12),
      m = i(p),
      f = n(13),
      I = i(f),
      h = {},
      v = function() {
        var e = Math.random();
        return h[e] ? initMappingID() : e
      },
      E = function() {
        var e = document.createElement("img");
        return e.style.position = "absolute", e
      },
      y = function(e, t, n) {
        var i = t.buttonType,
          o = t.hide,
          a = t.position,
          r = t.data,
          d = t.sessionFrom;
        "default-light" === i ? e.src = "contact" === n ? I["default"] : g["default"] : e.src = "contact" === n ? m["default"] : c["default"], e.style.top = a.top + "px", e.style.left = a.left + "px", e.style.width = a.width + "px", e.style.height = a.height + "px", e.style.zIndex = 1e8, e.dataset.data = r, e.dataset.sessionFrom = d, o && (e.style.display = "none")
      };
    t.insertShareButton = o, t.updateShareButton = a, t.removeShareButton = r, t.insertContactButton = d, t.updateContactButton = s, t.removeContactButton = u
  }, function(e, t) {
    e.exports = ""
  }, function(e, t) {
    e.exports = ""
  }, function(e, t) {
    e.exports = ""
  }, function(e, t) {
    e.exports = ""
  }, function(e, t) {
    "use strict";

    function n(e, t, n, i) {
      var o = {
        to: e,
        msg: n,
        command: t,
        ext: i
      };
      "backgroundjs" === e && (o.__id = d, d++), o = JSON.parse(JSON.stringify(o)), window.parent.postMessage(o, "*")
    }

    function i() {
      var e = Math.random();
      return l[e] ? initMappingID() : e
    }

    function o() {
      window.EditBridge = g;
      var e = document.createEvent("UIEvent");
      e.initEvent("EditBridgeReady", !1, !1), document.dispatchEvent(e), n("contentscript", "SHAKE_HANDS", {})
    }

    function a() {
      "complete" === document.readyState ? o() : window.addEventListener("load", function(e) {
        o()
      })
    }
    Object.defineProperty(t, "__esModule", {
      value: !0
    });
    var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
      return typeof e
    } : function(e) {
      return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
    };
    t["default"] = a;
    var d = 0;
    window.addEventListener("message", function(e) {
      var t = e.data;
      if (t && "object" === ("undefined" == typeof t ? "undefined" : r(t))) {
        var n = t.to;
        if ("webframe" === n) {
          var i = t.command,
            o = t.msg,
            a = t.ext;
          if ("RETURN_RES" === i) {
            var d = parseInt(o.ret),
              g = a.callID;
            0 === d ? l[g](null, o.res) : l[g](o.ret, {})
          } else if ("FILE_CHANGE" === i) {
            var p = o.eventType,
              m = o.fileName,
              f = o.info;
            s && s(p, m, f)
          } else "WINDOW_CHANGE" === i ? u && u(o.eventType) : "WEBVIEW_SHOW_CHANGE" === i ? A && A(o.editWebview) : "OPEN_FILE" === i && c && c(o)
        }
      }
    });
    var s, u, A, c, l = {},
      g = {};
    g.on = function(e, t) {
      "FILE_CHANGE" === e && (s = t), "WINDOW_CHANGE" === e && (u = t), "WEBVIEW_SHOW_CHANGE" === e && (A = t), "OPEN_FILE" === e && (c = t)
    }, g.getFileList = function(e, t) {
      var o = void 0,
        a = void 0;
      t ? (o = e, a = t) : (o = {}, a = e);
      var r = i();
      l[r] = a, n("backgroundjs", "GET_FILE_LIST", {
        options: o
      }, {
        callID: r
      })
    }, g.getFile = function(e, t) {
      var o = i();
      l[o] = t, n("backgroundjs", "GET_FILE_DATA", {
        path: e
      }, {
        callID: o
      })
    }, g.saveFile = function(e, t, o) {
      var a = i();
      l[a] = o, n("backgroundjs", "SAVE_FILE_DATA", {
        path: e,
        data: t
      }, {
        callID: a
      })
    }, g.addFile = function(e, t) {
      var o = i();
      l[o] = t, n("backgroundjs", "ADD_FILE", {
        path: e
      }, {
        callID: o
      })
    }, g.delFile = function(e, t) {
      var o = i();
      l[o] = t, n("backgroundjs", "DEL_FILE", {
        path: e
      }, {
        callID: o
      })
    }, g.rename = function(e, t, o) {
      var a = i();
      l[a] = o, n("backgroundjs", "RENAME_FILE", {
        oldPath: e,
        newPath: t
      }, {
        callID: a
      })
    }, g.mkdir = function(e, t) {
      var o = i();
      l[o] = t, n("backgroundjs", "MAKE_DIR", {
        path: e
      }, {
        callID: o
      })
    }, g.rmdir = function(e, t) {
      var o = i();
      l[o] = t, n("backgroundjs", "RM_DIR", {
        path: e
      }, {
        callID: o
      })
    }, g.getProjectInfo = function(e) {
      var t = i();
      l[t] = e, n("backgroundjs", "GET_PROJECT_INFO", {}, {
        callID: t
      })
    }, g.setEditWebview = function(e, t) {
      var o = i();
      l[o] = t, n("backgroundjs", "SET_EDIT_WEBVIEW", {
        editWebview: e
      }, {
        callID: o
      })
    }, g.findStr = function(e, t, o) {
      "function" == typeof t && (o = t, t = {
        cwd: "."
      }), t.cwd || (t.cwd = ".");
      var a = i();
      l[a] = o, n("backgroundjs", "FIND_STR", {
        options: t,
        str: e
      }, {
        callID: a
      })
    }, g.showFileInFolder = function(e) {
      var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
      n("backgroundjs", "SHOW_ITEM_IN_FOLDER", {
        options: t,
        filePath: e
      })
    }, g.formatCode = function(e) {
      var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
        o = arguments[2],
        a = i();
      l[a] = o, n("backgroundjs", "FORMAT_CODE", {
        code: e,
        options: t
      }, {
        callID: a
      })
    }
  }])
});
